﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;

namespace AgileShare.Framework.SiteProvisioning.Definitions
{
	public class FieldLinkDefinition
	{
		public FieldLinkDefinition() { }

		/// <summary>
		/// Initializes a new instance of the <see cref="FieldLinkDefinition"/> class.
		/// </summary>
		/// <param name="fieldId">The field id.</param>
		public FieldLinkDefinition(Guid fieldId)
		{
			this.Id = fieldId;
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="FieldLinkDefinition"/> class.
		/// </summary>
		/// <param name="fieldId">The field id.</param>
		/// <param name="displayName">The display name.</param>
		public FieldLinkDefinition(Guid fieldId, string displayName)
		{
			this.Id = fieldId;
			this.DisplayName = displayName;
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="FieldLinkDefinition"/> class.
		/// </summary>
		/// <param name="fieldId">The field id.</param>
		/// <param name="required">if set to <c>true</c> [required].</param>
		public FieldLinkDefinition(Guid fieldId, bool required)
		{
			this.Id = fieldId;
			this.Required = required;
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="FieldLinkDefinition"/> class.
		/// </summary>
		/// <param name="fieldId">The field id.</param>
		/// <param name="displayName">The display name.</param>
		/// <param name="hidden">The hidden.</param>
		/// <param name="readOnly">The read only.</param>
		/// <param name="required">The required.</param>
		/// <param name="showInDisplayForm">The show in display form.</param>
		public FieldLinkDefinition(Guid fieldId, string displayName, bool? hidden, bool? readOnly, bool? required, bool? showInDisplayForm)			
		{
			this.Id = fieldId;
			this.DisplayName = displayName;
			this.Hidden = hidden;
			this.ReadOnly = readOnly;
			this.Required= required;
			this.ShowInDisplayForm = showInDisplayForm;
		}

		/// <summary>
		/// Gets or sets the display name.
		/// </summary>
		/// <value>
		/// The display name.
		/// </value>
		public string DisplayName { get; set; }

		/// <summary>
		/// Gets or sets a value indicating whether this <see cref="FieldLinkDefinition"/> is hidden.
		/// </summary>
		/// <value>
		///   <c>true</c> if hidden; otherwise, <c>false</c>.
		/// </value>
		public bool? Hidden { get; set; }

		/// <summary>
		/// Gets the id.
		/// </summary>
		public Guid Id { get; set; }

		/// <summary>
		/// Gets or sets a value indicating whether [read only].
		/// </summary>
		/// <value>
		///   <c>true</c> if [read only]; otherwise, <c>false</c>.
		/// </value>
		public bool? ReadOnly { get; set; }

		/// <summary>
		/// Gets or sets a value indicating whether this <see cref="FieldLinkDefinition"/> is required.
		/// </summary>
		/// <value>
		///   <c>true</c> if required; otherwise, <c>false</c>.
		/// </value>
		public bool? Required { get; set; }

		/// <summary>
		/// Gets or sets a value indicating whether [show in display form].
		/// </summary>
		/// <value>
		///   <c>true</c> if [show in display form]; otherwise, <c>false</c>.
		/// </value>
		public bool? ShowInDisplayForm { get; set; }
	}
}
